import request from '@/utils/request'

// 查询答卷列表
export function listExam(query) {
  return request({
    url: '/api/exam/list',
    method: 'get',
    params: query
  })
}

/**
 * 查看我的试卷
 * @param query
 * @returns {*}
 */
export function myListExam(query) {
  return request({
    url: '/api/exam/myList',
    method: 'get',
    params: query
  })
}


// 查询答卷详细
export function getExam(examId) {
  return request({
    url: '/api/exam/' + examId,
    method: 'get'
  })
}

// 新增答卷
export function addExam(data) {
  return request({
    url: '/api/exam',
    method: 'post',
    data: data
  })
}

export function addPaperExam(data) {
  return request({
    url: '/api/exam/addPaperExam',
    method: 'post',
    data: data
  })
}

// 修改答卷
export function updateExam(data) {
  return request({
    url: '/api/exam',
    method: 'put',
    data: data
  })
}

// 删除答卷
export function delExam(examId) {
  return request({
    url: '/api/exam/' + examId,
    method: 'delete'
  })
}
